package com.yxch.admin.mapper.home;

import com.yxch.admin.model.commen.QsPoint;
import com.yxch.admin.model.home.*;
import com.yxch.admin.model.commen.Direction;
import com.yxch.admin.model.commen.DirectionVO;
import com.yxch.admin.model.commen.Function;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface HomeMapper {
    CourseIntro getCourseIntro(Integer courseId);

    void updateCourseIntro(CourseIntro courseIntro);

    List<TeacherTeam> getTeam(Integer courseId);

    void updateTeam(TeacherTeam teacherTeam);

    void deleteTeamTeachers(List<Integer> ids);

    Boolean addTeamTeacher(@Param("phoneNum") String phoneNum, @Param("courseId") int courseId);

    /**
     * 获取试卷方向
     *
     * @return
     */
    @Select("select direction_id,direction_title,description,image from direction where direction_id=#{direction_id}")
    DirectionVO getDirection(Integer direction_id);

    /**
     * 获取题库知识点
     *
     * @return
     */
    List<Direction> getQspoint(Integer direction_id);


    List<Function> getFunction();

    HomeData getHomeBaseData();

    Map getLoginDaysData();

    Map getCommentDaysData();

    List<BingData> countUsersByType();

    List<BingData> countUsersByGender();

    List<PointData> countQuestionsByPoint();

    void addFunction(Function function);

    void updateFunction(Function function);

    void deleteFunction(List<Integer> ids);
    
    Integer getIdByPhone(String phoneNum);

    void addTeam(TeacherTeam teacherTeam);

    void addPoint(QsPoint qsPoint);
}
